package  com.rx.mgt.service;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rx.mgt.dao.SysParamDao;
import com.rx.mgt.domain.SysParam;


@Service
public class SysParamService {
	private static Logger logger = Logger.getLogger(SysParamService.class);

	@Autowired
	SysParamDao sysParamDao;

	public SysParam getSysParamByKey(String group,String paramKey){
		return sysParamDao.getSysParamByKey(group, paramKey);
	}

	public String getSysParamByCache(String group,String paramKey,int cacheTimeout){
		SysParam sysParam = getSysParamByKey(group, paramKey);
		if(sysParam!=null){
			logger.info("===JSAPICertLocalPath=== "+sysParam.getParamValue());
			String resultValue=sysParam.getParamValue();
			return resultValue;
		}else{
		    return  null;
		}
	}
	public void update(SysParam t){
	    sysParamDao.update(t);
	}

}
